package com.zhb.sys.shiro.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
@Document
public class User implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6184701584006419072L;

	private String id;
	@Id
	private String mongoId;

	private String userName;

	private String password;

	private String realName;

	private String phone;

	private String email;

	private Date registerTime;

	private String roles;

	// 用户和角色的关系
	private List<Role> roleList;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id == null ? null : id.trim();
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName == null ? null : userName.trim();
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password == null ? null : password.trim();
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName == null ? null : realName.trim();
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone == null ? null : phone.trim();
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email == null ? null : email.trim();
	}

	public Date getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	public String getRoles() {
		return roles;
	}

	public void setRoles(String roles) {
		this.roles = roles;
	}

	public List<Role> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<Role> roleList) {
		this.roleList = roleList;
	}
	
	public String getMongoId() {
		return mongoId;
	}

	public void setMongoId(String mongoId) {
		this.mongoId = mongoId;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", userName=" + userName + ", password="
				+ password + ", realName=" + realName + ", phone=" + phone
				+ ", email=" + email + ", registerTime=" + registerTime
				+ ", roles=" + roles + ", roleList=" + roleList + "]";
	}
	
	public User() {
		super();
	}
	public User(String userName, String realName, String phone, String email) {
		super();
		this.userName = userName;
		this.realName = realName;
		this.phone = phone;
		this.email = email;
	}
}